package com.xyz.pojo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicUpdate;

import com.xyz.enums.OrderStatusEnum;
import com.xyz.enums.PayStatusEnum;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@DynamicUpdate
@Entity(name = "order_master")
public class OrderMaster {

	/**
	 * 订单ID
	 */
	@Id
	@Column(name = "order_id")
	private String orderId;
	/**
	 * 买家名字
	 */
	@Column(name = "buyer_name")
	private String buyerName;
	/**
	 * 买家手机号码
	 */
	@Column(name = "buyer_phone")
	private String buyerPhone;

	/**
	 * 买家地址
	 */
	@Column(name = "buyer_address")
	private String buyerAddress;

	/**
	 * 买家微信ID
	 * 
	 */
	@Column(name = "buyer_openid")
	private String buyerOpenid;

	/**
	 * 订单金额
	 */
	@Column(name = "order_amount")
	private BigDecimal orderAmount;

	/**
	 * 订单状态，默认0新下单
	 */
	@Column(name = "order_status")
	private Integer orderStatus = OrderStatusEnum.NEW.getCode();

	/**
	 * 支付状态,默认0未支付
	 */
	@Column(name = "pay_status")
	private Integer payStatus = PayStatusEnum.WAIT.getCode();

	/**
	 * 订单创建时间
	 */
	@Column(name = "create_time")
	private Date createTime = new Date();

	/**
	 * 订单跟时间
	 */
	@Column(name = "update_time")
	private Date updateTime = new Date();

	@Transient
	private List<OrderDetail> orderDetailList;

}